import http from "../axios/api";
import { createFormData } from "@/utils/utils.js";

//let url ='http://192.168.119.55:8083'
let url = "https://www.xiaoguobx.com/prod-api";
// let url = "192.168.10.160:8088";
// const _host =  process.env.NODE_ENV=="development" ?  '/api':  'http://xiaoguoai.cn/api'; //'http://qo.bzhuan888.com'
// console.log(_host)
// http://xiaoguoai.cn/api/ht/login?username='主页'&password='123456'&access_token=

// 获取 学科、版本、年级
export async function getSubjet() {
  return http.get(`${url}/wechat/applet/subject/grade/edition`);
}
// 获取章节
export async function getUnit(params) {
  return http.get(`${url}/wechat/applet/unit/book/${params}`);
}

// 根据选择单元随机推送测评题目
export async function getUnievaluationQuestiont(params) {
  return http.post(`${url}/wechat/applet/evaluationQuestion/search`, params);
}

//保存用户答案及相关信息
export async function evaluationCheck(params) {
  return http.post(`${url}/wechat/applet/evaluationCheck`, params);
}

//用户已体检
export async function loginPhone(parmas) {
  return http.post(`${url}/wechat/applet/loginPhone`, parmas);
}

// 通过wechat id查询是否已经成为意向客户
export async function getWechat(wechatId) {
  return http.get(`${url}/wechat/applet/customer/wechatId/${wechatId}`);
}

// 获取 邀请人信息
export async function getInviteInfo(id, type) {
  return http.get(`${url}/wechat/applet/organization/${id}/type/${type}`);
}

// 获取 分享信息
export async function wxShare(params) {
  return http.post(`${url}/wechat/applet/share`, params);
}

//验证码
export async function verificationCode(params) {
  return http.post(`${url}/wechat/applet/send/verificationCode`, params);
}

//获取试题信息
export async function getPaperInfo(param) {
  return http.get(`${url}/invite/report/info/${param}`);
}
